$(document).ready(function(){
$('#loginID').keyup(email_check);
});
	
function email_check(){	
var username = $('#emailcheck').val();
if(username == "" || username.length < 4){
$('#available').hide();
}else{
 
jQuery.ajax({
   type: "POST",
   url: "emailcheck.php",
   data: 'username='+ username,
   cache: false,
   success: function(response){
if(response == 1){
	$('#available').hide();
	$('#notavailable').fadeIn();
	}else{
	$('#notavailable').hide();
	$('#available').fadeIn();
	     }
 
}
});
} 
} 